<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

  <title>订单页面</title>
  <link href="/css/common.css"
        rel="stylesheet" type="text/css" />
  <link href="/css/cart.css"
        rel="stylesheet" type="text/css" />
  <link href="/css/product.css"
        rel="stylesheet" type="text/css" />
  <!-- 新 Bootstrap4 核心 CSS 文件 -->
  <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">

  <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>

  <!-- bootstrap.bundle.min.js 用于弹窗、提示、下拉菜单，包含了 popper.min.js -->
  <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>

  <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
  <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container header">
  <div class="span5">
    <div class="logo">
      <a> <img
              src="/image/r___________renleipic_01/logo.gif"
              alt="" />
      </a>
    </div>
  </div>
  <div class="span9">
    <div class="headerAd">
      <img src="/image/header.jpg"
           width="320" height="50" alt="正品保障" title="正品保障" />
    </div>
  </div>

  <!--	//插入主页-->
  <!--<%@ include file="menu.jsp"%>-->
</div>
<div class="container cart">
  <div class="span24">
    <nav class="navbar navbar-expand-sm bg-light">
      <!-- Links -->
      <ul class="navbar-nav">
        <li class="nav-item" style="margin: 2px 10px">
          <a class="nav-link" th:href="@{/seller/orderList(state=${3})}">显示已发货</a>
        </li>
        <li class="nav-item" style="margin: 2px 10px">
          <a lass="nav-link" th:href="@{/seller/orderList(state=${4})}">显示已收货</a>
        </li>
        <li class="nav-item" style="margin: 2px 10px">
          <a lass="nav-link" th:href="@{/seller/orderList(state=${2})}">显示待发货</a>
        </li>
        <li class="nav-item" style="margin: 2px 10px">
          <a lass="nav-link" th:href="@{/seller/orderList(state=${5})}">显示申请退款订单</a>
        </li>
        <li class="nav-item" style="margin: 2px 10px">
          <a lass="nav-link" th:href="@{/seller/orderList(state=${6})}">显示已退款订单</a>
        </li>
        <li class="nav-item" style="margin: 2px 10px">
          <a lass="nav-link" th:href="@{/seller/orderList(state=${8})}">显示拒绝退款订单</a>
        </li>
        <li class="nav-item" style="margin: 2px 10px">
          <a lass="nav-link" th:href="@{/seller/orderList(state=${7})}">显示订单成功</a>
        </li>
      </ul>

    </nav>
    <div class="container">
      <table class="table table-hover">
        <h3 style="margin: 35px 360px">我的订单</h3>

        <thead>
        <tr>
          <th >订单ID</th>
          <th>用户名</th>
          <th>商品名</th>
          <th>数量</th>
          <th>价格</th>
          <th>订单状态</th>
          <th>交易时间</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="order:${page.getRecords()}">
          <td th:text="${order.getOrderId()}"/>
          <td th:text="${order.getUsers().getUsername()}" />
          <td th:text="${order.getGoods().getGoodsName()}"/>
          <td th:text="${order.getOrderGoodsNumber()}"/>
          <td th:text="${order.getOrderPrice()}"/>
          <td th:switch="${order.getOrderState()}">

            <span th:case="0">已被删除</span>
            <span th:case="1">未支付</span>
            <span th:case="2">已支付/待发货</span>
            <span th:case="3">已发货</span>
            <span th:case="4">已收货</span>
            <span th:case="5">退款中</span>

            <span th:case="0">订单完成</span>
            <span th:case="1">未支付</span>
            <span th:case="2">待发货/
         <a th:href="@{/seller/confirmDeliver(orderId=${order.getOrderId()},state=${3})}">确认发货</a>
      </span>
            <span th:case="3">等待确认收货</span>
            <span th:case="4">已收货</span>
            <span th:case="5">
         <a th:href="@{/seller/confirmDeliver(orderId=${order.getOrderId()},state=${8})}">拒绝退款</a>
        /
         <a th:href="@{/seller/confirmDeliver(orderId=${order.getOrderId()},state=${6})}">确认退款</a>
      </span>
            <span th:case="6">已退款</span>
            <span th:case="7">订单完成</span>
            <span th:case="8">拒绝退款</span>
          </td>
          <td th:text="${order.getOrderCreateTime()}"/>
        </tr>

        </tbody>
      </table>
    </div>
    <ul class="pagination" style="margin: 35px 360px">
      <li class="page-item"><a class="page-link" th:href="@{/seller/orderList(index=${page.getCurrent()-1})}">上一页</a></li>
      <li class="page-item">
        <a class="page-link" th:href="@{/seller/orderList(index=${i})}"  th:each="i :${#numbers.sequence(1, 1)}" th:text="  ${i}"   ></a>
      </li>
      <li class="page-item"><a class="page-link" th:href="@{/seller/orderList(index=${page.getCurrent()+1})}">下一页</a></li>
    </ul>
  </div>

</div>
<div class="container footer" style="margin-top: 10%">
  <div class="span24">
    <div class="footerAd">
      <img src="/image/r___________renleipic_01/footer.jpg" alt="我们的优势"
           title="我们的优势" height="52" width="950">
    </div>
  </div>
  <div class="span24">
    <ul class="bottomNav">
      <li><hr></hr></li>
    </ul>
  </div>
  <div class="span24">
    <div class="copyright">Copyright ©  网上商城 版权所有</div>
  </div>
</div>
</body>
</html>